<?php
/**
 * User: aka
 * Time: 8:37
 */

namespace app\tenno\behavior;

use app\tenno\model\ClanActivity;
use app\tenno\model\GoodsEntry;
use app\tenno\model\Message;
use app\tenno\model\Mod;
use app\tenno\model\Other;
use app\tenno\model\Prime;
use app\tenno\model\Riven;
use think\facade\Session;

class GetDataCount
{
    public function run($params)
    {
        $modCount = Mod::where('delete_state','=',0)->count();
        $weaponCount = Prime::where('delete_state','=',0)->type(1)->count();
        $warFrameCount = Prime::where('delete_state','=',0)->type(2)->count();
        $rivenCount = Riven::where('delete_state','=',0)->count();
        $otherCount = Other::where('delete_state','=',0)->count();
        $messageCount = Message::where('delete_state','=',0)->count();
        $clanActivityCount = ClanActivity::where('delete_state','=',0)->count();
        $goodsEntryCount = GoodsEntry::where('delete_state','=',0)->count();
        $countSet = array();
        $countSet['mod_count'] = $modCount;
        $countSet['weapon_count'] = $weaponCount;
        $countSet['war_frame_count'] = $warFrameCount;
        $countSet['riven_count'] = $rivenCount;
        $countSet['other_count'] = $otherCount;
        $countSet['message_count'] = $messageCount;
        $countSet['clan_activity_count'] = $clanActivityCount;
        $countSet['goods_entry_count'] = $goodsEntryCount;
        Session::set('count_set',$countSet);
    }
}